package com.myj.jim.service.impl;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.myj.jim.dao.ArticleTypeDao;
import com.myj.jim.domain.ArticleType;
import com.myj.jim.service.ArticleTypeService;

@Service
public class ArticleTypeServiceImpl implements ArticleTypeService {

	@Autowired
	private ArticleTypeDao articleTypeDao;

	@Override
	public List<ArticleType> selectAllArticleType() {
		return articleTypeDao.selectAllArticleType();
	}

	@Override
	public Map<String, Object> getArticleTypeMap() {
		Map<String, Object> map = new LinkedHashMap<String, Object>();
		for(ArticleType at : articleTypeDao.selectAllArticleType()){
			map.put(at.getType(), at.getTypename());
		}
		return map;
	}
	

}
